package org.xin.framework.config.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;
import org.xin.common.result.ResultCode;

/**
 * @author Long
 * @version 1.0
 * @description:
 * @remarks:
 * @title CloudException
 * @date 2021/3/14 16:18
 */
public class CloudException extends AbstractException  {
    @Getter
    private int code;

    public CloudException(String message) {
        super(message);
    }

    public CloudException(ResultCode resultCode) {
        super(resultCode.getDesc());
        code = resultCode.getCode();
    }

    public CloudException(String message, ResultCode resultCode) {
        super(message);
        code = resultCode.getCode();
    }

    public CloudException(String message, Exception e) {
        this(message);
        e.printStackTrace();
    }

    public CloudException(Exception e) {
        super(e.getMessage());
        e.printStackTrace();
    }


    public CloudException(String message, Throwable cause) {
        super(message, cause);
    }
}
